package com.my.db.test.mybatis.sensitive.interceptor;

import org.apache.ibatis.plugin.Invocation;
import org.apache.ibatis.plugin.Plugin;

import java.util.Properties;

/**
 * @author timo 2021/4/14
 */
public interface Interceptor extends org.apache.ibatis.plugin.Interceptor {

    //核心拦截逻辑
    Object intercept(Invocation invocation) throws Throwable;

    //拦截器链
    default Object plugin(Object target) {return Plugin.wrap(target, this);}

    //自定义配置文件操作
    default void setProperties(Properties properties) { }

}
